package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_database")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Database {
    @Id
    private Integer id;

    /**
     * 数据名称
     */
    private String name;

    /**
     * 数据库类型: 0.通用数据库 1.项目数据库 2.个人数据库
     */
    private Integer type;

    /**
     * 数据总数
     */
    @Column(name = "data_total")
    private Integer dataTotal;

    /**
     * 项目数量
     */
    @Column(name = "project_total")
    private Integer projectTotal;

    /**
     * 所属用户
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 所属用户
     */
    @Column(name = "project_user_ids")
    private String projectUserIds;

    /**
     * 创建时间
     */
    @Column(name = "updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updatedTime;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createdTime;
}